

import  TreeData from "./TreeData.js"

import  Row from "./basics/Row"


/**
 * 测试 合并树
 * @type {TreeData}
 */

let treeA=new TreeData();

let treeB=new TreeData();

let treeC=new TreeData();

treeA.addData(new Row(1),{name:1})
treeA.addData(new Row(2),{name:2})
treeA.addData(new Row(3),{name:3})
treeA.addData(new Row(4),{name:4})
treeA.addData(new Row(2,5),{name:5})
treeA.addData(new Row(2,6),{name:6})
treeA.addData(new Row(2,7),{name:7})
treeA.addData(new Row(5,8),{name:8})
treeA.addData(new Row(5,9),{name:9})


treeB.addData(new Row(11),{name:1})
treeB.addData(new Row(12),{name:2})
treeB.addData(new Row(13),{name:3})
treeB.addData(new Row(14),{name:4})
treeB.addData(new Row(12,15),{name:5})
treeB.addData(new Row(12,16),{name:6})
treeB.addData(new Row(12,17),{name:7})
treeB.addData(new Row(15,19),{name:9})
treeB.addData(new Row(16,20),{name:20})
treeB.addData(new Row(20,21),{name:21})
treeB.addData(new Row(20,22),{name:22})

treeA.toTow()
treeB.toTow()

treeC.merge(treeA,treeB,contrast)
debugger
console.log(treeC.data)

treeC.toTow();
debugger
console.log(treeC.data)

/**
 * 对比
 */
function   contrast(objA,objB){
    if(objA.name==objB.name){
        return true;
    }

    return false;
}